<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/dialog.js"></script>
<script type="text/javascript" language="JavaScript">
	var ordermain_infolist_js_noorderlist  = "[%$ST.ordermain_infolist_js_noorderlist%]";
	var ordermain_infolist_botton_addinfo  = "[%$ST.ordermain_infolist_botton_addinfo%]";
	$(window).load(function(){
		var h = $(window).height();
		$('#mainwindowhidden').css({height:h-100});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#docadd').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	});

	function formverify(formData, jqForm, options) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		var str=document.getElementsByName("orderdid[]");
		var objarray=str.length;
		if (objarray<1){
			alert(ordermain_infolist_js_noorderlist);
			return false;
		}
	}
	function saveResponse(options){
		if (options=='true'){
			var title=ordermain_infolist_botton_addinfo;
			var loadurl='index.php?archive=ordermain&action=orderadd&tab=false';
			parent.onbotton(title,loadurl,true)
			parent.closeifram();
		}else{
			parent.closeifram();
			alert(ordershipping_js_add_no);
		}
	}
	function fnupdate(orderdid){
		articlelist(orderdid)
	}

	function articlelist(orderdid){
		var str=document.getElementsByName("orderdid[]");

		var objarray=str.length;
		var chestr="";
		for (var i=0;i<objarray;i++){

			chestr+=str[i].value+",";
		}
		if (objarray<1){
			$('#articleloading').load('index.php?archive=article&action=ajaxarticlelist', {'did':orderdid});
		}else{
			var newsid=orderdid+chestr;
			$('#articleloading').load('index.php?archive=article&action=ajaxarticlelist', {'did':newsid});
		}
	}

	function delorderlist(getidname){
		var getid='#'+getidname;
		$(getid).remove();
		var str=document.getElementsByName("orderdid[]");
		var objarray=str.length;
		if (objarray<1){
			var um=document.getElementById("articleloading");
			um.innerHTML='<div class="infolist"><table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF"><tr><td align="center">'+ordermain_infolist_js_noorderlist+'</td></tr></table></div>'
		}
	}
</script>
<!--[if IE 6]>
<style type="text/css" media="screen"> 
body { behavior:url("templates/css/csshover.htc");} 
</style> 
<![endif]-->
</head>

<body class="bodyflow">
<div class="centerrightwindow">
	<form name="docadd" id="docadd" method="post" action="index.php?archive=ordermain&action=cookiesave">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="padding-left5 colorgorningage">[%$ST.ordermain_add_textinfo_1%]</span></span>
		</div>
		<div class="listitle">[%beark name=tablabel class=orderaddinfo%]</div>
		<div id="mainwindowhidden">
			<div class="loadingdiv" id="articleloading">
				<div class="infolist">
					<table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF">
						<tr>
							<td align="center">[%$ST.ordermain_infolist_js_noorderlist%]</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<div id="downbotton">
			<div id="subbotton">
				<table border="0" width="100%">
					<tr id="bottonsubmit">
						<td align="center">
							<table border="0">
								<tr>
									<td><input type="button" name="windowbutton" onclick="javascript:windowsdig('[%$ST.ordermain_infolist_botton_addinfo%]','iframe:index.php?archive=ordermain&action=searchdoc&freshid='+Math.random(),'650px','380px','iframe');" value="[%$ST.ordermain_infolist_botton_addinfo%]" class="buttonface"  title="[%$ST.ordermain_infolist_botton_addinfo%]" /></td>
									<td class="padding-left5"><input type="submit" name="Submit" id="submitbotton" value="[%$ST.botton_add_next%]" class="buttonface" title="[%$ST.botton_add_next%]"/></td>
									<td class="padding-left5"><input type="reset" name="reset" onClick="javascript:parent.closeifram();" id="release" value="[%$ST.botton_add_reset%]" class="buttonface"  title="[%$ST.botton_add_reset%]" /></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</div>
</body>
</html>